package box.data.pri.hessian.v4_0_7.services.name;

import java.io.IOException;

/**
 * Exception for faults when the fault doesn't return a java exception.
 * This exception is required for MicroHessianInput.
 */
public class NameServiceException extends IOException {
    private Throwable rootCause;

    /**
     * Zero-arg constructor.
     */
    public NameServiceException() {
    }

    /**
     * Create the exception.
     */
    public NameServiceException(String name) {
        super(name);
    }

    /**
     * Create the exception.
     */
    public NameServiceException(String name, Throwable rootCause) {
        super(name);

        this.rootCause = rootCause;
    }

    /**
     * Create the exception.
     */
    public NameServiceException(Throwable rootCause) {
        super(String.valueOf(rootCause));

        this.rootCause = rootCause;
    }

    /**
     * Returns the underlying cause.
     */
    public Throwable getRootCause() {
        return rootCause;
    }
}
